import request from '@/utils/request'

// 查询外部技术抢单列表
export function listPreempt(query) {
    return request({
        url: '/dashboard/preempt/list',
        method: 'get',
        params: query
    })
}

// 查询外部技术抢单详细
export function getPreempt(id) {
    return request({
        url: '/dashboard/preempt/' + id,
        method: 'get'
    })
}

// 检查用户是否已抢单
export function checkPreempt(gradOrdersId) {
    return request({
        url: '/dashboard/preempt/check/' + gradOrdersId,
        method: 'get'
    });
}

// 新增外部技术抢单
export function addPreempt(data) {
    return request({
        url: '/dashboard/preempt',
        method: 'post',
        data: data
    })
}

// 修改外部技术抢单
export function updatePreempt(data) {
    return request({
        url: '/dashboard/preempt',
        method: 'put',
        data: data
    })
}

// 删除外部技术抢单
export function delPreempt(id) {
    return request({
        url: '/dashboard/preempt/' + id,
        method: 'delete'
    })
}

// 派单
export function dispatchOrder(data) {
    return request({
        url: '/dashboard/preempt/dispatch',
        method: 'post',
        data: data
    })
}
